<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>统计分析列表</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form action="bizStatisticalAnalysis/dolist" method="post" name="searchForm" id="searchForm" role="form" class="form-horizontal">
            <div class="form-group">
                    <label class="col-sm-1 control-label">经销商代码：</label>
                    <div class="col-md-4">
                                <input type="text" class="form-control" name="code" value="${entity.code}" placeholder="经销商代码">
                    </div>
                    <label class="col-sm-1 control-label">经销商名称：</label>
                    <div class="col-md-4">
                                <input type="text" class="form-control" name="name" value="${entity.name}" placeholder="经销商名称">
                    </div>
            </div>
            <div class="form-group">
                    <label class="col-sm-1 control-label">组长：</label>
                    <div class="col-md-4">
                                <input type="text" class="form-control" name="implLeader" value="${entity.implLeader}" placeholder="小组">
                    </div>
                    <label class="col-sm-1 control-label">批次：</label>
                    <div class="col-md-4">
                            <d:select clazz="selectpicker" name="count" id="count" list="${counts}" selected="${entity.count}"/>
                    </div>
                   
            </div>
            <div class="form-group">
                    <label class="col-sm-1 control-label">实施时间：</label>
                    <div class="col-md-4">
                            <input type="text" class="span1 Wdate" style="width:205px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd', maxDate:'#F{$dp.$D(\'endImplTime\')}'})" id="beginImplTime" name="beginImplTime" value="${searchEntity.beginImplTime}" placeholder="开始时间" /> 至 
							<input type="text" class="span1 Wdate" style="width:205px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd', minDate:'#F{$dp.$D(\'beginImplTime\')}'})" id="endImplTime" name="endImplTime" value="${searchEntity.endImplTime}" placeholder="结束时间" />
                    </div>
                   	<label class="col-sm-1 control-label">采集日期：</label>
                    <div class="col-md-4">
						<input type="text" class="span1 Wdate" style="width:205px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd', maxDate:'#F{$dp.$D(\'endDateTime\')}'})" id="beginDateTime" name="beginDateTime" value="${searchEntity.beginDateTime}" placeholder="开始时间" /> 至 
						<input type="text" class="span1 Wdate" style="width:205px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd', minDate:'#F{$dp.$D(\'beginDateTime\')}'})" id="endDateTime" name="endDateTime" value="${searchEntity.endDateTime}" placeholder="结束时间" />
					</div>
            </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">关键字：</label>
            <div class="col-md-4">
                <div class="input-group">
                    <input type="text" class="form-control" name="keywords" value="${searchEntity.keywords}" placeholder="">
                    <div class="input-group-btn">
                        <button id="searchBtn" type="button" class="btn btn-sm btn-info"><i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>

            </div>
        </div>
    </form>
    
    <!-- 导出表单 -->
    <form id= "exportexcalform" method=post action="${ctx}bizStatisticalAnalysis/export" target="_blank" >
					<input type="hidden" name="code" id="code"/>
					<input type="hidden" name="name" id="name" />
					<input type="hidden" name="implLeader" id="implLeader" />
					<input type="hidden" name="count" id="count" />
					<input type="hidden" name="beginImplTime" id="beginImplTime" />
					<input type="hidden" name="endImplTime" id="endImplTime" />
					<input type="hidden" name="beginDateTime" id="beginDateTime" />
					<input type="hidden" name="endDateTime" id="endDateTime" />
	</form>
    
    
    <div class="row">
        <div class="col-md-10">
            <%-- <p>
                <shiro:hasPermission name="BIZ_STATISTICAL_ANALYSIS:add">
                    <button type="button" data-url="bizStatisticalAnalysis/create" class="btn btn-sm btn-success link_add" data-title="新增统计分析"><i class="fa fa-plus"></i> 新增</button>
                </shiro:hasPermission>
                <shiro:hasPermission name="BIZ_STATISTICAL_ANALYSIS:edit">
                    <button type="button" data-url="bizStatisticalAnalysis/edit" class="btn btn-sm btn-primary link_edit" data-title="编辑统计分析"><i class="fa fa-edit"></i> 修改</button>
                </shiro:hasPermission>
                <shiro:hasPermission name="BIZ_STATISTICAL_ANALYSIS:delete">
                    <button type="button" data-url="bizStatisticalAnalysis/delete" class="btn btn-sm btn-danger link_del"><i class="fa fa-trash"></i> 删除</button>
                </shiro:hasPermission>
                <shiro:hasPermission name="BIZ_STATISTICAL_ANALYSIS:view">
                    <button type="button" data-url="bizStatisticalAnalysis/info" class="btn btn-sm link_info" data-title="统计分析详情"><i class="fa fa-book"></i> 详情</button>
                </shiro:hasPermission>
            </p> --%>
            <p>
            	<button id="export" type="button" url="bizStatisticalAnalysis/export" class="btn btn-sm btn-pink link_export" style="margin-left: 2px">导出</button>
            	<!-- <a id="export_menu_btn" onclick = "chartsDemo()" class="btn btn-sm btn-pink"><i class="fa fa-file-excel-o icon-share"></i>折线</a> -->
            	<!-- <a id="export_menu_btn" onclick = "chartsDemo()" class="btn btn-sm btn-pink"><i class="fa fa-file-excel-o icon-share"></i>柱状</a> -->
            	<a id="export_menu_btn" onclick = "chartsDemo()" class="btn btn-sm btn-pink"><i class="fa fa-file-excel-o icon-share"></i>饼状</a>
            </p>
        </div>
    </div>

    <table id="table_data" class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
            <th class="center td-checkbox" width="5%">
                <label><input type="checkbox" class="check-all ace" data-tableid="table_data" /><span class="lbl"></span></label>
            </th>
            <th width="7%">经销商代码</th>
            <th width="16%">经销商名称</th>
            <th width="6%">使用量</th>
            <th width="6%">索赔使用量</th>
            <th width="6%">进厂量</th>
            <th width="8%">使用率</th>
            <th width="8%">小组</th>
            <th width="12%">实施时间</th>
            <th width="12%">采集日期</th>
            <th width="8%">批次</th>
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
<!-- 返回顶部  -->
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var table = $("#table_data").dataTable({
            ajax: function(data, callback, settings){
                tableAjax($("#searchForm"),data, callback, settings);
            },
            //列表表头字段
            columns: [
                mainConfig.checkboxColumn,
                { "data": "code",name:"code",orderable:false },
                { "data": "name",name:"name",orderable:false},
                { "data": "useAmount",name:"use_amount",orderable:false },
                { "data": "claimAmount",name:"claim_amount",orderable:false },
                { "data": "dayAmount",name:"day_amount",orderable:false },
                { "data": "useRate",name:"use_rate",orderable:true },
                { "data": "implLeader",name:"impl_leader",orderable:false },
                { "data": "implTimeStr",name:"impl_time",orderable:true },
                { "data": "dateStr",name:"date",orderable:true },
                { "data": "countStr",name:"count",orderable:false }
        ]
    }).api();

        //查询条件
        $("#searchForm").submit(function(){
            table.ajax.reload();
            return false;
        });
    });
    
    
    function exportexcal(){
    	 if($.trim($("#code").val())=='' && $.trim($("#name").val())=='' && $.trim($("#implGroup").val())=='' && $.trim($("#count").val())=='' && $.trim($("#beginImplTime").val())=='' && $.trim($("#endImplTime").val())=='' && $.trim($("#beginDateTime").val())=='' && $.trim($("#endDateTime").val())=='' ){
			layer.alert("没有任何筛选条件，导出动作被取消！");
			return false;
		}  
		$('#exportexcalform input[name="code"]').val($.trim($("#code").val()));
		$('#exportexcalform input[name="name"]').val($.trim($("#name").val()));
		$('#exportexcalform input[name="implLeader"]').val($.trim($("#implLeader").val()));
		$('#exportexcalform input[name="count"]').val($.trim($("#count").val()));
		$('#exportexcalform input[name="beginImplTime"]').val($.trim($("#beginImplTime").val()));
		$('#exportexcalform input[name="endImplTime"]').val($.trim($("#endImplTime").val()));
		$('#exportexcalform input[name="beginDateTime"]').val($.trim($("#beginDateTime").val()));
		$('#exportexcalform input[name="endDateTime"]').val($.trim($("#endDateTime").val()));
		$('#exportexcalform').submit();
	}
    
    function chartsDemo(){
		var layerIndex = layer.open({
            title: "报表demo",
            type: 2,
            content: "/bizStatisticalAnalysis/chartDemo",
            area: ['580px', '400px']
        });
	}
    
</script>
<!-- script end -->
</body>
</html>